﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SlidePhoto
{
    public partial class MainFormViewer : Form
    {
        private string[] showContents;
        private int currentImage = 2;

        public MainFormViewer(string[] showContent)
        {
            InitializeComponent();

            showContents = showContent;
            this.Text = showContents[0];
            pictureBox.ImageLocation = showContents[2];
            timer.Start();
        }

        private void timer_Tick(object sender, EventArgs e)
        {
            timer.Stop();
            if (currentImage == showContents.Length - 2)
            {
                MessageBox.Show("Dit was het einde van de show.");
                Application.Exit();
            }
            else
            {
                currentImage += 1;
                pictureBox.ImageLocation = showContents[currentImage];                
            }
            timer.Start();
        }
    }
}
